function signFile(){
    $("#imgInfo").empty();
    div = document.getElementById("imgInfo");
    div.innerHTML += "文件名：" + $("#fileSign").val() + "&nbsp;"+ "<br/>";

    var  fileSign=$("#fileSign").val();

    if(fileSign==null||fileSign==0||fileSign==undefined){
        alert("文件未导入");
        return;
    }
    $.ajax( {
        url:'signFile',// 跳转到 action
        data:{
            inData : fileSign
        },
        type:'post',
        cache:false,
        dataType:'json',
        success:function(data) {
            if(data.success){
                $("#signFileVal").val(data.msg);
            }else{
                alert(data.msg);
            }
        },
        error : function() {
            // view("异常！");  
            alert("异常！");
        }
    });
}

function valifySignFile(){
    var  fileSign=$("#fileSign").val();
    var signFileVal=$("#signFileVal").val();
    var getCert=$("#getCert").val();
    if(fileSign==null||fileSign==0||fileSign==undefined){
        alert("文件未导入");
        return;
    }
    if(signFileVal==null||signFileVal==0||signFileVal==undefined){
        alert("签名值为空");
        return;
    }
    if(getCert==null||getCert==0||getCert==undefined){
        alert("证书为空，请获取证书");
        return;
    }
    $.ajax( {
        url:'verifySignFile',// 跳转到 action
        data:JSON.stringify({
            inData : fileSign,
            signValue : signFileVal,
            cert: getCert
        }),
        contentType: "application/json; charset=utf-8",
        type:'post',
        cache:false,
        dataType:'json',
        success:function(data) {
            if(data.success){
                $("#valifySignFile").val("文件签名验证成功！");
            }else{
                $("#valifySignFile").val(data.msg);
            }
        },
        error : function() {
            // view("异常！");  
            alert("异常！");
        }
    });
}